package com.kantboot.functional.third.party.google.web.controller;

import com.kantboot.functional.third.party.google.service.ITpGoogleService;
import com.kantboot.system.user.domain.vo.LoginVO;
import com.kantboot.util.common.result.RestResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/functional-third-party-web/google")
@RestController
public class ThirdPartyGoogleController {

    @Resource
    private ITpGoogleService service;

    /**
     * 获取谷歌的ClientId
     */
    @RequestMapping("/getClientId")
    public RestResult<String> getClientId(){
        return RestResult.success(service.getClientId(), "getClientIdSuccess","获取谷歌的ClientId成功");
    }

    /**
     * 登录
     */
    @RequestMapping("/login")
    public RestResult<LoginVO> login(@RequestParam("credential") String credential){
        return RestResult.success(service.login(credential), "loginSuccess","登录成功");
    }
}
